Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix-synapse: 1.9.1 -> 1.11.1 #80447

Merged
merged 3 commits into from
Mar 16, 2020
Merged

matrix-synapse: 1.9.1 -> 1.11.1 #80447

merged 3 commits into from
Mar 16, 2020

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Feb 18, 2020

Motivation for this change

This updates matrix-synapse to 1.11.1.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Ma27 Ma27 added the 9.needs: port to stable A PR needs a backport to the stable release. label Feb 18, 2020
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 8.has: changelog 8.has: documentation 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 18, 2020
@Ma27
Copy link
Member Author

Ma27 commented Feb 18, 2020

@GrahamcOfBorg test matrix-synapse postgresql

@ofborg ofborg bot requested a review from Ralith February 18, 2020 16:08
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Feb 18, 2020
@jonringer
Copy link
Contributor

I fixed pythonPackages.signedjson #80449, not sure if you just want to pull the changes into this pr or not

Copy link
Contributor

@mguentner mguentner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Anyone got an idea how this can be backported to 19.09 or any following release for that matter as we would add some changes to the postgresql module which might not be desired.

@Ma27
Copy link
Member Author

Ma27 commented Feb 18, 2020

Anyone got an idea how this can be backported to 19.09 or any following release for that matter as we would add some changes to the postgresql module which might not be desired.

I'm actually using this on 19.09 already (my matrix HS is still running 19.09 on a custom branch based on release-19.09 with this change cherry-picked on top) and the database still works fine (you get a warning at the beginning though), so it should be fine (considering the fact that 19.09 will only live for a few months at most).

EDIT: to clarify: synapse only refuses to start on fresh instances with wrong lc_ctype/lc_collate, existing databases remain usable (for now).

Copy link
Member

@Ekleog Ekleog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the short lifetime of 19.09 is actually an argument in favor of not backporting there, as the risk of breakage with a revert looks higher than the risk of breakage without a revert IMO

@Ekleog
Copy link
Member

Ekleog commented Feb 19, 2020

(however, I do think it totally makes sense to backport to 20.03, because even though we're technically past cut-off time, we haven't said it's stabilized yet, and the risk of breakage in the following 9 months is quite high, given we're speaking of synapse)

@Ma27
Copy link
Member Author

Ma27 commented Feb 19, 2020

(however, I do think it totally makes sense to backport to 20.03, because even though we're technically past cut-off time, we haven't said it's stabilized yet, and the risk of breakage in the following 9 months is quite high, given we're speaking of synapse)

Just for the record: we backported every release of matrix-synapse to stable in the past (at least since I'm taking care of the package) as many releases either contained important bugfixes or were needed due to some infrastructure changes at matrix.org that would break a self-hosted synapse otherwise.

@Ma27
Copy link
Member Author

Ma27 commented Mar 14, 2020

Please don't merge it yet. @florianjacob made some good suggestions about how we should document this and I'd like to add this (already started working on it) first :)

@FRidh FRidh added the 2.status: work-in-progress This PR isn't done label Mar 14, 2020
@Ma27
Copy link
Member Author

Ma27 commented Mar 15, 2020

@GrahamcOfBorg test matrix-synapse

Copy link
Contributor

@mguentner mguentner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice documentation. Looks good to me.

* Linkify all service options used in the code-examples.
* Demonstrated the use of `riot-web.override {}`.
* Moved the example how to configure a postgresql-database for
  `matrix-synapse` to this document from the 20.03 release-notes.
@Ma27 Ma27 removed the 2.status: work-in-progress This PR isn't done label Mar 16, 2020
@Ma27
Copy link
Member Author

Ma27 commented Mar 16, 2020

Just pushed a change which fixes a minor typo in the docs. As soon as the eval is finished, I'll merge this now. The latest changes from Sunday were documentation-related (and reviewed by @mguentner), the actual update has been discussed pretty much now and should be mergable.

Also, I'm running matrix-synapse 1.11.1 on NixOS 19.09 for a while now without any issues, the change should be fairly safe to use (and to backport).

Thanks a lot for everyone involved here!

@Ma27 Ma27 merged commit a2e06fc into NixOS:master Mar 16, 2020
@Ma27 Ma27 deleted the bump-matrix-synapse branch March 16, 2020 09:56
@aanderse
Copy link
Member

Thanks for all your work on this @Ma27 🎉

@Ma27
Copy link
Member Author

Ma27 commented Mar 16, 2020

Backported to stable:

@Ma27 Ma27 added 8.has: port to stable A PR already has a backport to the stable release. and removed 9.needs: port to stable A PR needs a backport to the stable release. labels Mar 16, 2020
@mguentner
Copy link
Contributor

mguentner commented Mar 16, 2020

Thanks to everyone involved, especially @Ma27

@ajs124 ajs124 mentioned this pull request Mar 23, 2020
10 tasks
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Oct 9, 2023
…B to be up

Closes NixOS#236062

The PR NixOS#236062 was submitted because of the following problem: a synapse
instance was running in a NixOS container attached to the host network
and a postgresql instance on the host as database. In this setup,
synapse connected to its DB via 127.0.0.1, but the DB wasn't locally set
up and thus not configured in NixOS (i.e.
`config.services.postgresql.enable` was `false`). This caused the
assertion removed in this patch to fail.

Over three years ago this assertion was introduced when this module
stopped doing autoconfiguration of postgresql entirely[1] because a
breaking change in synapse couldn't be managed via an auto-upgrade on
our side. To make sure people don't deploy their DB away by accident,
this assertion was introduced.

Nowadays this doesn't serve any value anymore because people with
existing instances should've upgraded by now (otherwise it's their job
to carefully read the release notes when missing upgrades for
several years) and people deploying fresh instances are instructed by
the docs to also configure postgresql[2].

Instead, it only causes issues in corner cases like NixOS#236062, so after
some discussion in that PR I think it's time to remove the assertion
altogether.

Also, there's no `Requires=` for `postgresql.service` in the systemd
units which means that it's not strictly guaranteed that the DB is up
when synapse starts up. This is fixed now by adding `requires`. To avoid
being bitten by above mentioned cases again, this only happens if
`config.services.postgresql.enable` is `true`.

If somebody uses a non-local postgresql, but has also deployed a local
postgresql instance on the synapse server (rather unlikely IMHO), it's
their job to opt out of this behavior with `mkForce` (this is precisely one
of the use-cases `mkForce` and friends were built for IMHO).

[1] NixOS#80447
[2] https://nixos.org/manual/nixos/stable/#module-services-matrix-synapse
@luochen1990
Copy link
Contributor

Could you please have a look at this PR #339195 ? I need some help since I haven't write a unit test for postgresql (especially in nixpkgs) before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.severity: security Issues which raise a security issue, or PRs that fix one 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 8.has: changelog 8.has: documentation 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: port to stable A PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.